<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title>仪表盘 - FinalCMS Admin</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

<link rel="stylesheet" href="${ctx}/css/bootstrap.min.css" />
<link rel="stylesheet" href="${ctx}/css/font-awesome.min.css" />
<link rel="stylesheet" href="${ctx}/css/jquery-ui.custom.min.css" />
<link rel="stylesheet" href="${ctx}/css/fc-fonts.css" />
<link rel="stylesheet" href="${ctx}/css/fc.min.css" />
<link rel="stylesheet" href="${ctx}/css/jquery.gritter.css" />
<!--[if lte IE 9]>
	<link rel="stylesheet" href="${ctx}/css/fc-part2.min.css" />
<![endif]-->
<link rel="stylesheet" href="${ctx}/css/fc-skins.min.css" />
<link rel="stylesheet" href="${ctx}/css/fc-rtl.min.css" />

<!--[if lte IE 9]>
  <link rel="stylesheet" href="${ctx}/css/fc-ie.min.css" />
<![endif]-->

<!--[if lte IE 8]>
<script src="${ctx}/js/html5shiv.js"></script>
<script src="${ctx}/js/respond.min.js"></script>
<![endif]-->
</head>

<body class="no-skin">
<?include("../../inc/menu.html",{current:"post_article"}){}?>
<div class="main-content">
	<div class="breadcrumbs" id="breadcrumbs">
		<script type="text/javascript">
			try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
		</script>

		<ul class="breadcrumb">
			<li><i class="ace-icon fa fa-home home-icon"></i> <a href="${ctx}/admin/index">首页</a>
			</li>
			<li class="active">发布内容</li>
		</ul>
		<div class="nav-search" id="nav-search">
			<form class="form-search">
				<span class="input-icon"> 
					<input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
					<i class="ace-icon fa fa-search nav-search-icon"></i>
				</span>
			</form>
		</div>
	</div>

	<div class="page-content">
		<?include("../../inc/function.html"){}?>
		<div class="page-header">
				<h1>发布内容 </h1>
			</div><!-- /.page-header -->
			<div class="row">
				<form action="/admin/content/saveContent" method="post" id="frm">
					<div class="col-xs-12">
						<!-- PAGE CONTENT BEGINS -->
						<div class="header green clearfix" style="border-bottom: 0px;">
							<label for="content_title" class="col-sm-1 control-label" style="font-size:28px;">分类</label>
							<#fc:select data="${@org.yi.fc.entity.FContentType.dao.queryContentType(null,null,null,null)}" class="input-sm col-xs-2" id="content_type" name="fContent.content_type" valueName ="id" displayName="type_name_cn" selectedValue="${fcontent.content_type!''}"   />
							<label for="content_author" class="col-sm-1 control-label" style="font-size:28px;">作者</label>
							<input type="text" name="fContent.content_author" id="content_author" class="input-sm col-xs-2" value="${fcontent.content_author!}"/>
							<label for="content_source_from" class="col-sm-1 control-label" style="font-size:28px;">来源</label>
							<input type="text" name="fContent.content_source_from" id="content_source_from" class="input-sm col-xs-5" value="${fcontent.content_source_from!}"/>
						</div>
						<div class="header green clearfix">
							<label for="content_title" class="col-sm-2 control-label" style="font-size:28px;">页面标题</label>
							<input data-toggle="tooltip" data-placement="top" title="标题不能为空" type="text" name="fContent.content_title" id="content_title" class="input-sm col-xs-10 tooltip-error" value="${fcontent.content_title!}"/>
						</div>
						<div class="header green clearfix">
							<label for="content_title" class="col-sm-2 control-label" style="font-size:28px;">页面关键词</label>
							<input data-toggle="tooltip" data-placement="top" title="页面关键词" type="text" name="fContent.content_keyword" id="content_title" class="input-sm col-xs-10 tooltip-error" value="${fcontent.content_keyword!}"/>
						</div>
						<div class="header green clearfix">
							<label for="content_title" class="col-sm-2 control-label" style="font-size:28px;">页面描述</label>
							<input data-toggle="tooltip" data-placement="top" title="页面描述<" type="text" name="fContent.content_describle" id="content_title" class="input-sm col-xs-10 tooltip-error" value="${fcontent.content_describle!}"/>
						</div>							
						<input type="hidden" id="content" name="fContent.content">
						<script class="" id="editor" type="text/plain" style="height: 500px;">${fcontent.content!}</script>
						<!-- PAGE CONTENT ENDS -->
					</div><!-- /.col -->
					<br>
					<div class="" style="float: right;margin: 10px 15px 5px;">
							<button class="btn btn-info" type="button" id="sub">
								<i class="ace-icon fa fa-check bigger-110"></i>
								保存
							</button>
					</div>
					<input type="hidden" name="cms_token" value="${cms_token!''}">
				</form>
			</div><!-- /.row -->
		</div><!-- /.page-content -->
	</div>  
	<?include("../../inc/footer.html"){}?>
	
<!--[if !IE]> -->
<script type="text/javascript">
		window.jQuery || document.write("<script src='${ctx}/js/jquery2.1.0.min.js'>"+"<"+"/script>");
	</script>
<!-- <![endif]-->

<!--[if IE]>
<script type="text/javascript">
 	window.jQuery || document.write("<script src='${ctx}/js/jquery1.11.0.min.js'>"+"<"+"/script>");
</script>
<![endif]-->
<script type="text/javascript">
		if('ontouchstart' in document.documentElement) document.write("<script type='text/javascript' src='${ctx}/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
	</script>
<script type="text/javascript" src="${ctx}/js/bootstrap.min.js"></script>

<!--[if lte IE 8]>
	  <script type="text/javascript" src="${ctx}/js/excanvas.min.js"></script>
<![endif]-->

<script type="text/javascript" src="${ctx}/js/fc-extra.min.js"></script>
<script type="text/javascript" src="${ctx}/js/fc.min.js"></script>

<!-- 消息提示框插件 -->
<script type="text/javascript" src="${ctx}/js/jquery.gritter.min.js"></script>

<!-- 富文本编辑器插件 -->
<script type="text/javascript" charset="utf-8" src="${ctx}/ext/ueditor1_4_3/ueditor.config.js"></script>
   <script type="text/javascript" charset="utf-8" src="${ctx}/ext/ueditor1_4_3/ueditor.all.min.js"> </script>
   <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
   <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
   <script type="text/javascript" charset="utf-8" src="${ctx}/ext/ueditor1_4_3/lang/zh-cn/zh-cn.js"></script>

<script>
   //实例化编辑器
   //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
   var ue = UE.getEditor('editor');
   
   /**
    * 提交文章	
    */
   function sub(){
   	if($.trim($("#content_title").val()).length == 0){
   		$("#content_title").focus().tooltip("show");
   		return false;
   	}
   	$("#content").val(ue.getContent());
   	$("#frm").submit();
   }
   
   $("#sub").click(sub);
   if('${msgStatus!}' != '' && '${msg!}' != ''){
	$.gritter.add({
		title: '' && 0 == '${msgStatus!}' ? '提示' : '警告',
		sticky: false, //提示框是否不消失
		text: '${msg!}',
		class_name: 'gritter-center ' +   ( 0 == '${msgStatus!}' ? ' gritter-error' : ' gritter-success' )
	});
   }
</script>
</body>
</html>
